package com.zhkj.framework.exception;

import com.zhkj.framework.enums.ResultEnum;

/**
 * @Auther: zhangy
 * @Date: 2018/10/17 08:31
 * @Description: 自定义异常对象，增加code
 */
public class CommonException extends RuntimeException {

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public CommonException(ResultEnum resultEnum){
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

    public CommonException(Integer code,String msg){
        super(msg);
        this.code = code;
    }

}
